package com.sz.designpattern.behavior11.memento;

public class Test {
    public static void main(String[] args) {
        Game game = new Game();
        game.play();

        Memento memento = game.createMemento();
        Caretaker caretaker = new Caretaker();
        caretaker.setMemento(memento);
        game.exit();


        System.out.println("Test.main---");

        Game game1 = new Game();
        game1.setMemento(caretaker.getMemento());
        game1.play();
        game1.exit();


    }
}
